package com.cqc.updatedemo02;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.dou361.update.UpdateHelper;
import com.dou361.update.listener.ForceListener;
import com.dou361.update.type.UpdateType;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        UpdateHelper.getInstance()
                .setUpdateType(UpdateType.autoupdate)
                .setForceListener(new ForceListener() {
                    @Override
                    public void onUserCancel(boolean force) {
                        if (force) {
                            finish();
                        }
                    }
                })
                .check(MainActivity.this);
    }
}
